<script type="text/javascript" src="../media/system/js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="../media/system/js/jQuery.vietvang.validate.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$('#adminForm').validate({
			});
		});
</script>
<div id="jm-left" class="" >
    <div class="jm-module " id="">
       <div class="jm-module-content">
          <h3 class="jm-title">指導者情報</h3>
          <h2 class="title_h2">◆検索</h2>
          <div class="content-message">
            <table style="width:220px" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td  style="width:30px" height="24" align="right" nowrap="">■&nbsp;</td>
                        <td  style="width:170px">地区を選択</td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <select id="area" name="area" style="width: 130px;" >
                                <option value="0" selected="selected">指定しない</option>
                                <?php
                                    foreach($this->area as $value){
                                  ?>
                                  <option value="<?php echo $value->AREA_CODE; ?>"<?php if ($this->list['area'] == $value->AREA_CODE) { echo ' selected="selected"';} ?>>
                                  <?php echo $value->AREA_NAME; ?></option>
                                  <?php
                                    }
                                  ?>
                            </select>
                        
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2"></td>
                    </tr>
                    <tr>
                        <td width="30" height="24" align="right" nowrap="">■&nbsp;</td>
                        <td width="170">都道府県を選択</td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <span id="area_pref">
                                <select style="width: 130px;" id="pref" name="pref">
                                 <option value="0" selected="selected">指定しない</option>    
                                      <?php
                                        foreach($this->pref as $value){
                                      ?>
                                      <option value="<?php echo $value->PREF_CODE; ?>"<?php if ($this->list['pref'] == $value->PREF_CODE ) { echo ' selected="selected"';} ?>>
                                      <?php echo $value->PREF_NAME; ?></option>
                                      <?php
                                        }
                                      ?>
                                </select>
                            </span>
                        
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2"></td>
                        </tr>
                    <tr>
                        <td height="24" align="right" nowrap="">■&nbsp;</td>
                        <td>指導者名を入力</td>
                    </tr>
                    <tr>
                        <td></td>
                        <td><input name="nameld" id="nameld" type="text" size="16" value="<?php echo $this->list['nameld']?>"/></td>
                    </tr>
                    <tr>
                        <td colspan="2"></td>
                        </tr>
                    <tr>
                    <tr>
                        <td height="24" align="right" nowrap="">■&nbsp;</td>
                        <td>指導者資格を選択</td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <table>
                                <tr>
                                    <td><input type="checkbox" name="chb1" id="chb1" value="1" <?php if(isset($this->list['chb1'])){ echo 'checked="checked"'; } ?> /></td>
                                    <td><label for="chb1">アドバンスト</label></td>
                                    <td><input type="checkbox" name="chb2" id="chb2" value="2" <?php if(isset($this->list['chb2'])){ echo 'checked="checked"'; } ?> /></td>
                                    <td><label for="chb2">アクア</label></td>
                                </tr>
                                
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2"></td>
                        </tr>
                    <tr>
                    <tr>
                        <td height="24" align="right" nowrap="">■&nbsp;</td>
                        <td>研修回を入力</td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <table>
                                <tr>
                                    <td>
                                        <input type="text" style="width: 120px;" name="term" id="term" vvName="number" value="<?php echo $this->list['term']?>" />
                                    <!-- <span style="color: red;" name="msg_error"></span> -->
                                    </td>
                                    <td>
                                        <select name="unit" id="unit">
                                           <option value="0" selected="selected">全て</option>
                                           <option value="1" <?php if ($this->list['unit'] == 1) { echo ' selected="selected"';} ?>>回</option>
                                           <option value="2" <?php if ($this->list['unit'] == 2) { echo ' selected="selected"';} ?>>期</option>
                                           <option value="3" <?php if ($this->list['unit'] == 3) { echo ' selected="selected"';} ?>>年度</option>
                                           
                                        </select>
                                    </td>
                                </tr>
                                
                                
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2"></td>
                    </tr>
                    <tr>
                        <td height="24" align="right" nowrap="">■&nbsp;</td>
                        <td>その他の条件を選択</td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <table>
                                <tr>
                                    <td><input type="checkbox" name="wokf" id="wokf" value="1" <?php if(isset($this->list['wokf'])){ echo 'checked="checked"'; } ?> /></td>
                                    <td><label for="wokf">常勤</label></td>
                                </tr>
                                  
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2"></td>
                        </tr>
                    <tr>
                    <tr>
                        <td height="24" align="right" nowrap="">■&nbsp;</td>
                        <td>事業協力（AND検索）</td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <table>
                                    <?php
                                            
                                            foreach($this->lkdt as $key=>$value){
                                                $i++;
                                        ?>
                                        <tr>
                                        
                                        <td>
                                            <input type="checkbox" name="chl<?php echo $value->LKDT_CODE; ?>" id="chl<?php echo $value->LKDT_CODE; ?>" value="<?php echo $value->LKDT_NAME; ?>" <?php if(isset($this->list['chl'.$value->LKDT_CODE])){ echo 'checked="checked"'; } ?>  />
                                        </td>                                                                                                           
                                        <td>
                                            <label for="chl<?php echo $value->LKDT_CODE; ?>"><?php echo $value->LKDT_NAME; ?></label>
                                        </td>
                                        </tr>
                                        <?php    
                                                }    
                                            
                                        ?>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2"></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td align="center">
                            <!-- <input type="submit" name="Search" value="検索" id="submit"/> -->
                            <button onClick="Joomla.submitbutton('search');" >検索</button>
                        </td>
                    </tr>
                    </tbody></table>
          </div>
           
            <input type="hidden" name="check" value="1"/>
          <div class="clearfix"></div>
       </div>
    </div>
    
 </div>
 <script>
 jq(document).ready(function(){       
		jq("#area").change(function(){
		  
			var id = document.getElementById("area").value;
			var url = "index.php?top=page&option=com_frleader&task=selectArea&area_code="+id;
            jq.get(url, function(data) {
              jq('#area_pref').html(data);
            });
            	
		})
 	});
</script>